#!/bin/bash 

function my_sum(){
	sum=0
	for i in $1
	do
		((sum+=$i))
	done
	echo $sum
}

read -p "请输入一个数组(空格分隔元素):" -a ARR
RET=`my_sum "${ARR[*]}"`
echo $RET
